#include "stdafx.h"
#include "DocPoint.h"

bool DocPoint::operator==(DocPoint& pt)
{
	return (this->row == pt.row && this->col == pt.col);
}

bool DocPoint::operator!=(DocPoint& pt)
{
	return !(*this == pt);
}

bool DocPoint::operator<(DocPoint& pt)
{
	bool result;
	if(this->row < pt.row)
	{
		result = true;
	}
	else if(this->row > pt.row)
	{
		result = false;
	}
	else if(this->row == pt.row)
	{
		if(this->col < pt.col) result = true;
		else result = false;
	}
	return result;
}

bool DocPoint::operator>(DocPoint& pt)
{
	return !(*this < pt);
}

bool DocPoint::operator<=(DocPoint& pt)
{
	return (*this == pt) || (*this < pt);
}

bool DocPoint::operator>=(DocPoint& pt)
{
	return (*this == pt) || (*this > pt);
}

DocPoint::DocPoint(int row, int col)
{
	this->row = row;
	this->col = col;
}

DocPoint::DocPoint()
{
	row = col = 0;
}